var HyvesBridge = {}, hyvesAuthWin, swfId;

HyvesBridge.available = function () {
	return true;
}

HyvesBridge.setFlashElement = function (id) {
    swfId = id;
};

HyvesBridge.callAuthorize = function (url) {
    hyvesAuthWin = window.open(url, "hyvesAuthWin", "width=780, height=500");
};

HyvesBridge.verify = function () {
	window.opener.HyvesBridge.passVerifier(window.location.href);
	window.close();
};

HyvesBridge.passVerifier = function (token) {
	if (!swfId) {
		alert("You never called HyvesBridge.setFlashElement!");
	} else {
        flash = document.getElementById(swfId);
        flash.setVerifier(token); 
    }
};
